package org.iocdemo.springiocdemo.component;

import jakarta.annotation.Resource;
import org.iocdemo.springiocdemo.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {

    @Bean
    public String name(){
        return "lisi";
    }
    @Bean
    public String name2(){
        return "lisi2";
    }
    @Bean
    public Student s2(@Qualifier("name")String n){
        return new Student(n,18);
    }
    @Bean()
    public Student s1(){
        return new Student("李飒",20);
    }

}
